package spring6.iocxml.factorybean;

import com.beust.ah.A;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.testng.annotations.Factory;
import org.testng.annotations.Test;

public class TestUser {
    @Test
    public void TestUser(){
        ApplicationContext context = new ClassPathXmlApplicationContext("bean-factorybean.xml");
        User user = (User) context.getBean("user");
//        System.out.println(user);  通过MyFactoryBean生成指定对象
//      context -> .getBean -> MyFactoryBean -> User
    }
}
